<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 2020/8/16
  Time: 19:22
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../../base.jsp" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<!DOCTYPE html>
<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>数据 - AdminLTE2定制版</title>
    <meta name="description" content="AdminLTE2定制版">
    <meta name="keywords" content="AdminLTE2定制版">
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 页面meta /-->
</head>
<body>
<div id="frameContent">
    <!-- 内容头部 -->
    <section class="content-header" class="content-wrapper" style="margin-left:0px;">
        <h1>
            产品管理
            <small>产品表单</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="all-admin-index.html"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="all-order-manage-list.html">产品管理</a></li>
            <li class="active">产品编辑</li>
        </ol>
    </section>
    <!-- 内容头部 /-->

    <!-- 正文区域 -->
    <section class="content">

        <!--订单信息-->
        <div class="panel panel-default">
            <div class="panel-heading">产品信息</div>
            <form id="editForm" action="/cargo/factoryProduct/edit.do" method="post" class="uk-form">
                <%--隐藏域厂家ID和产品ID--%>
                <input type="hidden" id="factoryId" name="factoryId" value="${factory.id}">
                <input type="hidden" id="id" name="id" value="${factoryProduct.id}">
                <input type="hidden" id="factoryName" name="factoryName" value="${factory.factoryName}">
                <div class="row data-type" style="margin: 0px">
                    <div class="col-md-2 title">产品编号</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="产品编号" name="productNo"
                               value="${factoryProduct.productNo}">
                    </div>

                    <div class="row data-type" style="margin: 0px">
                        <div class="col-md-2 title">生产厂家</div>
                        <div class="col-md-4 data">
                            <select class="form-control" name="factoryId" id="factoryInfo" onchange="document.getElementById('factoryName').value=this.options[this.selectedIndex].text">
                                <option value="">请选择</option>
                                <c:forEach items="${factoryList}" var="factory">
                                    <option value="${factory.id}" ${factoryProduct.factoryId eq factory.id ? "selected" : ""}>
                                            ${factory.factoryName}
                                    </option>
                                </c:forEach>
                            </select>
                        </div>

                        <div class="col-md-2 title">市场价</div>
                        <div class="col-md-4 data">
                            <input type="text" class="form-control" placeholder="市场价" name="price"
                                   value="${factoryProduct.price}">
                        </div>

                        <div class="col-md-2 title">颜色</div>
                        <div class="col-md-4 data">
                            <input type="text" class="form-control" placeholder="颜色" name="color"
                                   value="${factoryProduct.color}">
                        </div>

                        <div class="col-md-2 title">包装</div>
                        <div class="col-md-4 data">
                            <input type="text" class="form-control" placeholder="包装" name="packing"
                                   value="${factoryProduct.packing}">
                        </div>

                        <div class="col-md-2 title">描述</div>
                        <div class="col-md-4 data">
                            <input type="text" class="form-control" placeholder="描述" name="description"
                                   value="${factoryProduct.description}">
                        </div>

                        <div class="col-md-2 title">数量</div>
                        <div class="col-md-4 data">
                            <input type="text" class="form-control" placeholder="数量" name="qty"
                                   value="${factoryProduct.qty}">
                        </div>

                        <div class="col-md-2 title">包装单位</div>
                        <div class="col-md-4 data">
                            <input type="text" class="form-control" placeholder="包装单位" name="qty"
                                   value="${factoryProduct.packingUnit}">
                        </div>

                        <div class="col-md-2 title rowHeight2x">备注</div>
                        <div class="col-md-10 data rowHeight2x">
                                <textarea class="form-control" rows="3"
                                          name="remarks">${factoryProduct.remark}</textarea>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <!--订单信息/-->

        <!--工具栏-->
        <div class="box-tools text-center">
            <button type="button" onclick='document.getElementById("editForm").submit()' class="btn bg-maroon">保存
            </button>
            <button type="button" class="btn bg-default" onclick="history.back(-1);">返回</button>
        </div>
        <!--工具栏/-->

    </section>
    <!-- 正文区域 /-->

</div>
<!-- 内容区域 /-->
</body>
<script type="text/javascript">
    $(function () {
        $(".datepicker").datepicker({
            language: "zh-CN",
            autoclose: true,//选中之后自动隐藏日期选择框
            clearBtn: true,//清除按钮
            format: "yyyy-mm-dd"//日期格式，详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
        });
    });
</script>
</html>